package src.util;

import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory;

public class ConnectionUtil {
	
	public static Connection getConnection () throws Exception{
		ConnectionFactory factory = new ConnectionFactory();
		//设置参数
//		factory.setHost("192.168.32.129");
		factory.setHost("121.40.171.77");
		factory.setPort(5672);
//		factory.setVirtualHost("/");
		factory.setUsername("root");
		factory.setPassword("root");
		return factory.newConnection();
	}
}
